package sg.edu.nus.iss.pacman.manager.dao;

import sg.edu.nus.iss.pacman.dao.Maze;
import sg.edu.nus.iss.pacman.dao.MazeDao;
import sg.edu.nus.iss.pacman.dao.RmsMazeDao;

/**
 * Manager class to access Maze
 * 
 * @author Daniel
 *
 */
public class MazeManager {

	private MazeDao mazeDao;
	
	/**
	 * Constructor
	 */
	public MazeManager() {
		mazeDao = new RmsMazeDao();
	}
	
	/**
	 * Gets list of all mazes
	 * @return list of all mazes
	 */
	public Maze[] getMaze() {
		return mazeDao.getMaze();
	}
	
	/**
	 * Saves a maze
	 * @param maze maze
	 * @return
	 */
	public int saveMaze(Maze maze) {
		return mazeDao.saveMaze(maze);
	}
	
	/**
	 * Finds a maze based on maze id
     * @param name
	 * @return
	 */
	public Maze findMaze(String name) {
		return mazeDao.findMaze(name);
	}
	
	/**
	 * Deletes a maze
     * @param name
	 */
	public void deleteMaze(String name) {
		mazeDao.deleteMaze(name);
	}
}
